# 返回杨慧三角
def yanghuiTriangle(numRows):
    res = []
    for i in range(numRows):
        row = []
        for j in range(i + 1):
            if j == 0 or j == i:
                row.append(1)
            else:
                row.append(res[i - 1][j] + res[i - 1][j - 1])
        res.append(row)
    return res


print(yanghuiTriangle(0))  # []
print(yanghuiTriangle(1))  # [[1]]
print(yanghuiTriangle(2))  # [[1], [1, 1]]
print(yanghuiTriangle(3))  # [[1], [1, 1], [1, 2, 1]]
print(yanghuiTriangle(5))  # [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]
